<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <p:dialog modal="true" widgetVar="statusDialog" header="Status" draggable="false" closable="false" resizable="false">  
            <p:graphicImage value="http://localhost:8080/GiantExample-war/resources/img/icons/ajax-loading-bar.gif" />  
        </p:dialog>  

        <h:form id="form">  

            <p:commandButton value="Download" ajax="false" onclick="PrimeFaces.monitorDownload(start, stop);"
                             icon="ui-icon-arrowthichk-s">  
                <p:fileDownload value="#{reporteController.file}" />  
            </p:commandButton>  

        </h:form>  

        <script type="text/javascript">
                function start() {
                    statusDialog.show();
                }

                function stop() {
                    statusDialog.hide();
                }
        </script>  
    </h:body>
</html>

